﻿@model OrderModel.UploadLicenseModel

@{
    Layout = "~/Administration/Views/Shared/_AdminPopupLayout.cshtml";

    //page title
    ViewBag.Title = T("Admin.Orders.Products.License.UploadFile").Text;
}

@if (ViewBag.RefreshPage == true)
{
    <script type="text/javascript">
        try {window.opener.document.forms['@(ViewBag.formId)'].@(ViewBag.btnId).click();}
        catch (e){}
        window.close();
    </script>
}

@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
    <div class="content-header clearfix">
        <h1 class="pull-left">
            @T("Admin.Orders.Products.License.UploadFile")
        </h1>
        <div class="pull-right">
            &nbsp;
        </div>
    </div>

    <div class="content">
        @Html.ValidationSummary(false)
        <div class="form-horizontal">
            <div class="panel-group">
                <div class="panel panel-default">
                    <div class="panel-body">
                        @Html.HiddenFor(model => model.OrderId)
                        @Html.HiddenFor(model => model.OrderItemId)
                        <div class="form-group">
                            <div class="col-xs-12">
                                @Html.SDFEditorFor(model => model.LicenseDownloadId)
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-xs-2 col-xs-offset-4">
                                <button type="submit" name="uploadlicense" id="uploadlicense" class="btn btn-primary">
                                    @T("Admin.Common.Save")
                                </button>
                            </div>
                            <div class="col-xs-2">
                                @if (Model.LicenseDownloadId > 0)
                                {
                                    <button type="submit" name="deletelicense" id="deletelicense" class="btn bg-red">
                                        @T("Admin.Common.Delete")
                                    </button>
                                }
                                else
                                {
                                    <text>&nbsp;</text>
                                }
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
}
